package com.itzhoun.abstractFactory;

import com.itzhoun.CheesePizza;
import com.itzhoun.GreakPizza;
import com.itzhoun.PepperPizza;
import com.itzhoun.Pizza;

/**
 * @author 周楠
 * @Date 2023/01/12/上午 10:39
 */
public class BeiJinFactory implements BasePizzaFactory{

    @Override
    public Pizza createPizza(String type) {
        Pizza pizza = null;
        switch (type){
            case "cheese" : pizza = new CheesePizza(); break;
            case "greek" : pizza = new GreakPizza(); break;
            case "pepper" : pizza = new PepperPizza(); break;
            default: return null;
        }
        return pizza;
    }

    //补充： 工厂里面除了生产pizza， 还可以生产咖啡coffee
    public void createCoffee(){
        System.out.println("北京工厂胜场coffee");
    }
}
